package com.dingreading.cloud.soms.service.impl;

import com.dingreading.cloud.soms.entity.SubjectLesson;
import com.dingreading.cloud.soms.entity.table.SubjectLessonTableDef;
import com.dingreading.cloud.soms.mapper.SubjectLessonMapper;
import com.dingreading.cloud.soms.service.SubjectLessonService;
import com.mybatisflex.core.query.QueryCondition;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author EDY
 * @since 2025-11-03
 */
@Service
public class SubjectLessonServiceImpl extends BaseServiceImpl<SubjectLessonMapper, SubjectLesson, SubjectLessonTableDef> implements SubjectLessonService {

    @Override
    protected SubjectLessonTableDef getTable() {
        return SubjectLessonTableDef.subjectLesson;
    }

    @Override
    public List<SubjectLesson> getByLessonUids(List<String> uniqueLessonUids) {
        QueryCondition condition = QueryCondition.createEmpty()
                .and(table.uid.in(uniqueLessonUids))
                .and(table.enabled.eq(1));
        return getMapper().selectListByCondition(condition);
    }


}
